<?php
    $this->assign('title','Categorias');
    $this->assign('page_local','Categorias');
    $this->assign('page_now','listagem');
    $this->assign('panel_title','Categorias');
    $this->start('content_filter');
    echo $this->Search->create('',array('class'=>'form-inline'));
?>
<div class="form-group">
    <?php
        echo $this->Search->input('filter1',array('class'=>'form-control','placeholder'=>'Nome Categoria','autocomplete'=>'off'));
    ?>
</div>
<?php
    echo $this->Search->button('Filtro',array('class'=>'btn btn-primary'));
    echo $this->Search->end();

    $this->end();
    $this->start('content_table');
    if(!empty($expenses)):
        ?>
        <thead>
        <tr>
            <th class="col-sm-2">Grupo</th>
            <th>Nome</th>
            <th class="col-sm-2 text-center">#</th>
        </tr>
        </thead>
        <tbody>
        <?php foreach ($expenses as $expense): ?>
            <tr>
                <td>
                    <?php echo $this->Html->link($expense['ExpenseGroup']['name'], array('controller' => 'expense_groups', 'action' => 'view', $expense['ExpenseGroup']['id'])); ?>
                </td>
                <td><?php echo h($expense['Expense']['name']); ?>&nbsp;</td>
                <td class="text-center">
                    <?php echo $this->Func->btnOption($expense['Expense']['id']) ?>
                </td>
            </tr>
        <?php endforeach; ?>
        </tbody>
    <?php
    else:
        echo $this->Func->showMessage("Nenhum resultado foi encontrado em nossa base!",array('type'=>'info','close'=>false));
    endif;
    $this->end();
?>
